
# Name of tgz file to create.
TGZ=ect-$(shell date +%Y-%m-%d-%H%M%S).tgz

.PHONY : clean all test1 distclean dist test1-clean inst-clean

all: ectmake.beam
	mkdir -p make.dir/tmpbin
	erl -pz ebin -pz make.dir/tmpbin/ -s ectmake make_sh -noshell

ectmake.beam: ectmake.erl config.hrl
	erlc ectmake.erl

clean:
	rm -f ebin/*.beam
	rm -f src.erlang/*.beam
	rm -Rf make.dir
	rm -Rf build
	#cd test1; $(MAKE) $(MFLAGS) clean
	
distclean: clean
	rm -f ectmake.beam
	rm -f src/*~
	rm -f src.erlang/*~
	rm -f include/*~
	rm -f *~
	rm -f ect-*.tgz
#	cd test1; $(MAKE) $(MFLAGS) distclean

# dist: distclean
# 	cd ..; tar cfz ${TGZ} ect/README.TXT --no-recursion ect/Makefile ect/src/*.erl ect/include/*.hrl ect/test1/*.erl ect/test1/Makefile ect/ebin
# 	mv ../${TGZ} .
# 
#####
# test1-clean:
# 	rm -f test1/*.beam test1/*.class.hrl
# 
# test1: all
# 	cd test1; $(MAKE) $(MFLAGS)
# 	
# 
#install:
#	mkdir -p build/ect/ebin build/ect/include
#	cp -a include/ect.hrl build/ect/include
#	cp -a ebin/*.beam build/ect/ebin